#include<string.h>


char *maximumTime(char *time)
{
    int length = strlen(time);
    for (int i = 0; i < length; i++)
    {
        if (time[i] != '?')
            continue;
        else
        {
            if (i == 0) 
            {
                if (time[i + 1] >= '4' && time[i + 1] <= '9') 
                    time[i] = '1';
                else if (time[i + 1] >= '0' && time[i + 1] <= '3') 
                    time[i] = '2';
                else if (time[i + 1] == '?') 
                    time[i] = '2';
            }
            else if (i == 1) 
            {
                if (time[i - 1] == '2') 
                    time[i] = '3';
                else 
                    time[i] = '9';
            }
            else if (i == 3) 
            {
                time[i] = '5';
            }
            else if (i == 4) 
            {
                time[i] = '9';
            }
        }
    }
    return time;
}